﻿@model IList<Eoffice.Models.CVDI>

@{
    ViewBag.Title = "DANH SÁCH CÔNG VĂN ĐI";
    Layout = "~/Views/Shared/_LayoutPage.cshtml";
}

<h1>@ViewBag.Title</h1>

@*<div class="TopSearchImpExp">
    <br />Tìm theo &nbsp;
            <input type="radio" checked="checked" name="rdoLoai" /><span class="txtrdoLoai tn">&nbsp;số công văn đi</span>
            <input type="radio" name="rdoLoai" /><span class="txtrdoLoai">&nbsp;trích yếu công văn đi</span>
        @if (true)
        {
            <div class="searchTop">
                @{Html.RenderAction("timkiem_socvdi", "Search");}
            </div>
            <div class="h10"></div>
        }
    </div>*@

@Html.Partial("Search", "CvDi")

@using (Html.BeginForm())
{
    <div class="Control">
        <ul>
            <li>@Html.ActionLink("Thêm mới", "Create", "", new { @class = "vadd" })</li>
            <li>@Html.ActionLink("Làm mới", "Index", "", new { @class = "vrefresh" })</li>
            <li><a class="vback" href="javascript:void(0);" onclick="window.history.go(-1);">Trở lại</a></li>
        </ul>
    </div>
    <table class="TableView" border="1" id="myTable">
        <tr class="trHeader">
            <th class="CheckBoxsmall">
                <input type="checkbox" onclick="Javascript: chkSelectAll_OnClick(this)" id="chkSelectAll" />
            </th>
            <th class="Text">SỐ CVĐI</th>
            <th class="Date">NGÀY THÁNG </th>
            <th class="Text">LĨNH VỰC</th>
            <th class="Text">LOẠI CÔNG VĂN</th>
            <th class="Text">TRÍCH YẾU</th>
            <th class="Nhanvien">NHÂN VIÊN</th>
            <th class="Text">NGƯỜI NHẬN</th>
            <th class="Text">GHI CHÚ</th>

            <th class="Function"></th>
        </tr>

        @for (int i = 0; i < Model.Count; i++)
        {
            if (i % 2 == 0)
            {
            <tr id="trOdd_@i" class="trOdd" onmousemove="Javascript:chkSelect_OnMouseMove(this)" onmouseout="Javascript:chkSelect_OnMouseOut(this,0)">
                <td class="CheckBoxsmall">@Html.CheckBox("chk" + Model[i].SOCVDI, new { id = "chkSelect", onclick = "Javascript:chkSelect_OnClick(this,0)", @class = "chk" })</td>
                <td class="Text">@Html.ActionLink("Xem", "Details", new { id = Model[i].SOCVDI }, new { @class = "views", title = "Xem chi tiết" })&nbsp;@Html.DisplayFor(modelItem => Model[i].SOCVDI)</td>
                <td class="Date">@Html.DisplayFor(modelItem => Model[i].NGAYCVDI)</td>
                <td class="Text">@Html.DisplayFor(modelItem => Model[i].LINHVUC.TENLV)</td>
                <td class="Text">@Html.DisplayFor(modelItem => Model[i].LOAICV.TENLOAI)</td>
                <td class="trichyeu">@Html.ActionLink("Sửa", "Edit", new { id = Model[i].SOCVDI }, new { @class = "vedit", title = "Sửa" })&nbsp;@Html.Raw(Model[i].TRICHYEUCVDI)</td>
                <td class="Nhanvien">@Html.DisplayFor(modelItem => Model[i].NV.HOTENNV)</td>
                <td class="Text">@Html.DisplayFor(modelItem => Model[i].NGUOINHAN)</td>
                <td class="Text">@Html.DisplayFor(modelItem => Model[i].GHICHUCVDI)</td>
                
                <td class="Function">
                    @Html.ActionLink("Xóa", "Delete", new { id = Model[i].SOCVDI }, new { @onclick = "return DeleteConfirm()", @class = "vdelete" })</td>

            </tr>
            }
            else
            {
            <tr id="trEven_@i" class="trEven" onmousemove="Javascript:chkSelect_OnMouseMove(this)" onmouseout="Javascript:chkSelect_OnMouseOut(this,@i)">
                <td class="CheckBoxsmall">@Html.CheckBox("chk" + Model[i].SOCVDI, new { id = "chkSelect", onclick = "Javascript:chkSelect_OnClick(this,0)", @class = "chk" })</td>
                <td class="Text">@Html.ActionLink("Xem", "Details", new { id = Model[i].SOCVDI }, new { @class = "views", title = "Xem chi tiết" })&nbsp;@Html.DisplayFor(modelItem => Model[i].SOCVDI)</td>
                <td class="Date">@Html.DisplayFor(modelItem => Model[i].NGAYCVDI)</td>
                <td class="Text">@Html.DisplayFor(modelItem => Model[i].LINHVUC.TENLV)</td>
                <td class="Text">@Html.DisplayFor(modelItem => Model[i].LOAICV.TENLOAI)</td>
                <td class="trichyeu">@Html.ActionLink("Sửa", "Edit", new { id = Model[i].SOCVDI }, new { @class = "vedit", title = "Sửa" })&nbsp;@Html.Raw(Model[i].TRICHYEUCVDI)</td>
                <td class="Nhanvien">@Html.DisplayFor(modelItem => Model[i].NV.HOTENNV)</td>
                <td class="Text">@Html.DisplayFor(modelItem => Model[i].NGUOINHAN)</td>
                <td class="Text">@Html.DisplayFor(modelItem => Model[i].GHICHUCVDI)</td>

                <td class="Function">
                    @Html.ActionLink("Xóa", "Delete", new { id = Model[i].SOCVDI }, new { @onclick = "return DeleteConfirm()", @class = "vdelete" })</td>
            </tr>
            }
        }

    </table>
    @Html.Raw(ViewBag.Pager)
    <div class="Control">
        <ul>
            <li>@Html.ActionLink("Thêm mới", "Create", "", new { @class = "vadd" })</li>
            <li>@Html.ActionLink("Làm mới", "Index", "", new { @class = "vrefresh" })</li>
            <li><a class="vback" href="javascript:void(0);" onclick="window.history.go(-1);">Trở lại</a></li>
        </ul>
    </div>
}
